﻿// See https://aka.ms/new-console-template for more information
using ConsoleApp4;

Console.WriteLine("Hello, World!");
//1、初始化鱼竿
var fishingRod = new FishingRod();

//2、声明垂钓者
var jeff = new FishingMan("圣杰");

//3.分配鱼竿
jeff.FishingRod = fishingRod;

//4、注册观察者
fishingRod.FishingEvent += jeff.Update;

//5、循环钓鱼
while (jeff.FishCount < 5)
{
    jeff.Fishing();
    Console.WriteLine("-------------------");
    //睡眠5s
    Thread.Sleep(5000);
}